

//app.js
App({
  onLaunch: function () {
    console.log(this);
  },
  globalData: {
    userInfo: "用户"
  },
  /**
   * 页面跳转
   */
  goToPage: function (e) {
    let _opentype = e.currentTarget.dataset.opentype;
    let _link = e.currentTarget.dataset.link;

    if (_opentype == 'switchTab') {
      wx.switchTab({
        url: _link,
      })
    } else if (_opentype == 'navigate') {
      wx.navigateTo({
        url: _link,
      })
    } else if (_opentype == 'redirect') {
      wx.redirectTo({
        url: _link,
      })
    }
  },
  /**
   * 页面返回 
   */
  goBackPage:function(){
    wx.navigateBack({})
  }
})

